package cn.tedu.exec;

/**
 * 该类用于练习opp的巩固来练习
 *
 * @author ：Dsi
 * @date ：2021/11/5 16:11
 */
public class TestCar {
    public static void main(String[] args) {
        Car c = new Car();
//        c.brand = "XiaoMi";
//        c.length = 2;
//        c.color = "红色";
//        c.price = 439999;
//        System.out.println(c.brand);
//        System.out.println(c.price);
//        System.out.println(c.color);
//        System.out.println(c.length);

        c.dir();
        c.stop();

        c.setUser("我");
        System.out.println(c.getUser());
        c.setBrand("HuaWei");
        System.out.println(c.getBrand());
        c.setColor("白银");
        System.out.println(c.getColor());
        c.setLength(3.6);
        System.out.println(c.getLength());
        c.setPrice(999999);
        System.out.println(c.getPrice());

        Car c2 = new Car();
    }
}

class Car {
    private String brand;
    private String color;
    private double price;
    private double length;
    private String user;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public void dir() {
        System.out.println("车跑起来了");
    }

    public void stop() {
        System.out.println("车停下来了");
        outcar();
    }

    private void outcar() {
        System.out.println("你，下车了~");
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }
}